package com.xbongbong.saas.domain.entity;

import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.pro.enums.fund.enums.FundSetMenuEnum;
import com.xbongbong.pro.enums.fund.enums.ManageTypeEnum;
import com.xbongbong.pro.enums.fund.enums.ModelTypeEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author zcp
 * @version v1.0
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class FundSetEntity implements Serializable {
    private static final long serialVersionUID = 4573232659803291384L;

    /**
     * 主键
     */
    private Long id;
    /**
     * 公司id
     */
    private String corpid;
    /**
     * 所属模块XbbRefTypeEnum，默认1：1CRM，2JXC
     */
    private Integer refType;
    /**
     * 生成规则，默认值1：1手动创建应收，2按开票产生应收，3按出库产生应收
     * @see com.xbongbong.pro.enums.fund.enums.ModelTypeEnum
     */
    private Long sysLong10;
    /**
     * 管理方式，默认值1：1无账期，2企业统一管理账期，3根据客户管理账期，4根据合同订单管理账期
     * @see com.xbongbong.pro.enums.fund.enums.ManageTypeEnum
     */
    private Integer manageType;
    /**
     * 账期规则，为空则等同于无账期
     * [{"formId":1,"attr":"text_6","attrName":"客户分级","filter":[{"key":"1","type":1,"month":1,"day":1}]}]
     */
    private String periodFilter;
    /**
     * 备注
     */
    private String memo;
    /**
     * 备注
     */
    private String creatorId;
    /**
     * 参考FundSetMenuEnum的type
     */
    private Integer type;
    /**
     * 开启/关闭
     */
    private Integer enable;
    /**
     * 创建时间时间戳
     */
    private Long addTime;
    /**
     * 更新时间时间戳
     */
    private Long updateTime;
    /**
     * 删除标记
     */
    private Integer del;

    public FundSetEntity() {
    }

    public FundSetEntity(Integer refType) {
        this.refType = refType;
        this.type = FundSetMenuEnum.RECEIVABLE_RULES.getType();
        this.sysLong10 = ModelTypeEnum.PLAN.getCode();
        this.manageType = ManageTypeEnum.NONE.getCode();
        this.del = DelEnum.NORMAL.getDel();
    }

    public FundSetEntity(Integer refType, Integer type) {
        this.refType = refType;
        this.type = type;
        this.del = DelEnum.NORMAL.getDel();
    }
}
